#include <stdio.h>

int main() {
    FILE *fp;
    char buffer[1024];
    fp = popen("ls -l", "r");
    if (fp == NULL) {
        printf("Error: Failed to execute command.\n");
        return -1;
    }
    while (fgets(buffer, sizeof(buffer), fp) != NULL) {
        printf("%s", buffer);
    }
    pclose(fp);
    return 0;
}
